﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StockListMovimientoForm.aspx.cs"
 Inherits="UILGestion.AlmacenAdmin.StockListMovimientoForm" %>

<%@ Register Assembly="WebLib" Namespace="WebLib" TagPrefix="cc3" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %>
<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="cc1" %>
<%@ Register src="~/Control/menuCtrl.ascx" tagname="menuObraCtrl" tagprefix="uc1" %>

<%@ Register src="KardexItemGrid.ascx" tagname="KardexItemGrid" tagprefix="uc3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
      <link href="../css/main.css" rel="stylesheet" type="text/css" />
      <link rel="stylesheet" type="text/css" href="../estilos/_common/styles/fonts.css" />
 <link rel="stylesheet" type="text/css" href="../estilos/_common/styles/global.css" />
 <link rel="stylesheet" type="text/css" href="../estilos/_common/styles/theme.css" />
    <script type="text/javascript">

        function SelectInsumo(inp, data) {

    var insumoid = inp.id;


    var id = insumoid.replace("InsumoTxt", "idTxt");
    var insumo1id = insumoid.replace("InsumoTxt", "insumo1Txt");

    var codigoid = insumoid.replace("InsumoTxt", "codigoTxt");
    var insumo1id = insumoid.replace("InsumoTxt", "insumo1Txt");
    
    var familiaid = insumoid.replace("InsumoTxt", "familiaTxt");
    var subfamiliaid = insumoid.replace("InsumoTxt", "subFamiliaTxt");
    var unidadid = insumoid.replace("InsumoTxt", "unidadTxt");

    
    
    var objinsumo = document.getElementById(insumoid);

    var objid = document.getElementById(id);
    var objcodigo = document.getElementById(codigoid);
    var objinsumo1 = document.getElementById(insumo1id);
    var objfamilia = document.getElementById(familiaid);
    var objsubfamilia = document.getElementById(subfamiliaid);
    var objUnidad = document.getElementById(unidadid);

    objid.value = data[0];
    objcodigo.value = data[1];
    objinsumo.value = data[2];
    objinsumo1.value = data[2];
    objUnidad.value = data[3];
    objfamilia.value = data[4];
    objsubfamilia.value = data[5];
    

    }

</script>
   
</head>
<body style="background-color:White" >
        <form id="form1" runat="server">
    <cc2:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnableScriptGlobalization="true">
    </cc2:ToolkitScriptManager>
     <input id="idObra" type="hidden" runat="server"/>
     <input id="idAlmacen" type="hidden" runat="server"/>

     <uc1:menuObraCtrl ID="menuObraCtrl1" runat="server" />
       <asp:Panel ID="pnlMain" runat="server" 
      CssClass="Heading secTitle AreaHeading ms-crm-List-Header " 
              >
                <asp:Label ID="Label1" runat="server" Text="Kardex Movimiento " style="font-size: large; color: #960818"></asp:Label>
              </asp:Panel>
      
  
  
        <asp:Panel ID="Panel2" runat="server"  GroupingText="Buscar " >
        <table class="ms-crm-List-Header" >
       
        <tr>
        <td align="right" valign="top" class="style2" >
             Almacen: 
        </td>
        <td align="left"  >
             <asp:DropDownList ID="almacenesDropDownList" runat="server"    Width="350px">
            </asp:DropDownList>
           
        </td>
            <td align="left" >&nbsp;</td>
        </tr>
        <tr>
        <td >
             Buscar: </td>
        <td>
            <cc3:Input ID="InsumoTxt"  runat="server" Text=""  Width="400px"
             DataType="List"
             NumColum="2" 
             method="GetRecursos"  
              OnSelect="SelectInsumo"
             >
            </cc3:Input>




        </td>
            <td>
                &nbsp;</td>
        </tr>

        </table>
   

   </asp:Panel>

    <asp:Panel ID="insumoPanel" runat="server"  GroupingText="Insumo "   >

   
    <table class="ms-crm-List-Header">
    <tr>
    <td align="right">
        Descripcion:</td>
    <td colspan="3">
        <cc3:Input ID="insumo1Txt" runat="server" BackColor="Transparent" 
            ReadOnly="true" Width="450px"> </cc3:Input>
    </td>
    </tr>
    <tr>
    <td align="right" >ID:</td>
    <td >
        <cc3:Input ID="idTxt" runat="server" BackColor="Transparent" ReadOnly="true" 
            Text="" Width="100">
            </cc3:Input>
        </td>
        <td >
            SubFamilia:</td>
        <td  >
            <cc3:Input ID="subFamiliaTxt" runat="server" BackColor="Transparent" 
                ReadOnly="true" Text="" Width="250px"></cc3:Input>
        </td>
        <td>
            &nbsp;</td>
    </tr><tr>
    <td align="right">Codigo:</td>
    <td>
        <cc3:Input ID="codigoTxt" runat="server" BackColor="Transparent" 
            ReadOnly="true" Width="100" Text=""></cc3:Input>
        </td>
            <td align="right">
                Familia:</td>
            <td>
                <cc3:Input ID="familiaTxt" runat="server" BackColor="Transparent" 
                    ReadOnly="true" Text="" Width="250px"></cc3:Input>
            </td>
            <td>
                &nbsp;</td>
    </tr>
        <tr>
            <td align="right">
                Unidad:</td>
            <td colspan="3">
               <cc3:Input ID="unidadTxt" runat="server" BackColor="Transparent" 
                    ReadOnly="true" Text="" Width="70px" /></td>
            <td>
                &nbsp;</td>
        </tr>
    </table> 
    <table>
    <tr>
    <td>
        Fecha Inicio:</td>
    <td>
        <asp:TextBox ID="fechaInicioTxt" runat="server" Width="100px"></asp:TextBox>
        <asp:ImageButton ID="ImageButton1" runat="Server" 
                      AlternateText="Click aqui para mostrar calendario" font-names="Arial" 
                      Font-Size="X-Small" ImageUrl="~/Images/month.gif"  />
        <cc2:CalendarExtender ID="CalendarExtender1" runat="server"     
                                    TargetControlID="fechaInicioTxt"
        PopupButtonID="ImageButton1"></cc2:CalendarExtender>
             
    </td>
    <td>
        Fecha Fin:</td>
    <td>
        <asp:TextBox ID="fechaFinTxt" runat="server" Width="100px"></asp:TextBox>
        <asp:ImageButton ID="ImageButton2" runat="Server" 
                      AlternateText="Click aqui para mostrar calendario" font-names="Arial" 
                      Font-Size="X-Small" ImageUrl="~/Images/month.gif"  />
        <cc2:CalendarExtender ID="CalendarExtender2" runat="server"     
                                    TargetControlID="fechaFinTxt"
        PopupButtonID="ImageButton2"></cc2:CalendarExtender>
    </td>
    <td>
        <asp:Button ID="buscarBtn" runat="server"  
            Text=" Ver Movimiento" onclick="buscarBtn_Click"  />
&nbsp;</td>
    </tr>
    </table>
   
    </asp:Panel>

     <asp:UpdatePanel runat="server" ID="kardexItemPanel" UpdateMode="Conditional"  >
  <ContentTemplate>
      <uc3:KardexItemGrid ID="KardexItemGrid1" runat="server" DataSourceID="SaldoKardexODS"/>
   <%--<asp:GridView runat="server" id="grids"  DataSourceID="SaldoKardexODS"/>--%>
       <asp:ObjectDataSource ID="SaldoKardexODS" runat="server" EnablePaging="True" 
        SelectCountMethod="Count" SelectMethod="GetKardexMovimientoInsumo" SortParameterName="sortExpression"
        TypeName="BOL.KardexBL">
        <SelectParameters>
            <asp:ControlParameter Name="idAlmacen"   ControlID="almacenesDropDownList"    PropertyName="SelectedValue"/>
            <asp:ControlParameter Name="idInsumo"  ControlID="idTxt"  PropertyName="Text"/>
            <asp:ControlParameter Name="fechaInicio" Type="DateTime" ControlID="fechaInicioTxt"  />
            <asp:ControlParameter Name="fechaFin" Type="DateTime" ControlID="fechaFinTxt"  />
            <asp:Parameter Name="startRowIndex" Type="Int32" />
            <asp:Parameter Name="maximumRows" Type="Int32" />
            <asp:Parameter Name="sortExpression" Type="String" />
        </SelectParameters>
        
    </asp:ObjectDataSource>
    

  </ContentTemplate>
        <%--<Triggers>
        <asp:AsyncPostBackTrigger ControlID="buscarBtn" />
        </Triggers>--%>
    </asp:UpdatePanel>
 
 
        
    </form>
</body>
</html>
